﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using vHCS.K2App.Shared;
using Core.Common.Session;

namespace vHCS.K2App.MdlK2
{
    public partial class OverTimeRequestHis : Core.NTier.UserInterface.BaseFormNotPer
    {
        #region const
        protected const string _EmpID = "EmpID";
        protected const string _MonthYear = "MonthYear";
        protected const string _OverTimeID = "OverTimeID";
        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            // Check user incharge to view history
            //string userAccess = SessionManager.UserDomain;
            //int Id = Convert.ToInt32(Request.QueryString["OverTimeID"].ToString());
            //HistoryComment his = new HistoryComment();
            //if (!his.CheckUserInCharge(userAccess, Id, 3)) // If user not incharge
            //{
            //    Response.Redirect("../UnAuthorize.htm");
            //}

            this.txtEmpID.Text = (Request.QueryString[_EmpID] == null) ? string.Empty : Request.QueryString[_EmpID].ToString().Trim();
            this.txtMonthYear.Text = (Request.QueryString[_MonthYear] == null) ? string.Empty : Request.QueryString[_MonthYear].ToString().Trim();
            txtOverTimeID.Text = (Request.QueryString[_OverTimeID] == null) ? string.Empty : Request.QueryString[_OverTimeID].ToString().Trim();
            long EmpID = this.txtEmpID.Text != "" ? Convert.ToInt64(this.txtEmpID.Text) : 0;
            this.ucSerach.LoadEmpInfoByEmpId(EmpID);
            txtEmpID.Text = this.ucSerach.EmployeeId.ToString();
        }
    }
}